//
//  LabelViewController.swift
//  swift各类控件集锦
//
//  Created by iosdev1 on 2016/12/30.
//  Copyright © 2016年 zyy. All rights reserved.
//

import UIKit

class LabelViewController: ZyBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        let str1 = "根据固定的宽度算label的高度"
        let lbl1 = zyUIlblInitWith(title: str1, font: 14, color: UIColor.white, bgColor: UIColor.black)
        self.view.addSubview(lbl1)
        lbl1.numberOfLines = 0
        let h1 = zyUtilsgetContentSizeHeightFont(content: str1, widthContent: 100, font: 14)
        lbl1.frame = CGRect(x:10, y:5, width:100, height:h1)
        
        let str2 = "根据固定的宽度算label的高度根据固定的宽度算label的高度根据固定的宽度算label的高度根据固定的宽度算label的高度"
        let lbl2 = zyUIlblInitWith(title: str2, font: 14, color: UIColor.white, bgColor: UIColor.black)
        self.view.addSubview(lbl2)
        lbl2.numberOfLines = 0
        let h2 = zyUtilsgetContentSizeHeightFont(content: str2, widthContent: 100, font: 14)
        lbl2.frame = CGRect(x:130, y:45, width:100, height:h2)
        
        
        let str3 = "根据固定的高度算label的宽度"
        let lbl3 = zyUIlblInitWith(title: str3, font: 14, color: UIColor.white, bgColor: UIColor.black)
        self.view.addSubview(lbl3)
        let w1 = zyUtilsgetContentSizeWidthFont(content: str3, heightContent: 14, font: 14)
        lbl3.frame = CGRect(x:10, y:HEIGHT_SCREEN - 144, width:w1, height:20)

        let str4 = "根据固定的高度算label的宽度根据固定的高度算label的宽度"
        let lbl4 = zyUIlblInitWith(title: str4, font: 14, color: UIColor.white, bgColor: UIColor.black)
        self.view.addSubview(lbl4)
        let w2 = zyUtilsgetContentSizeWidthFont(content: str4, heightContent: 14, font: 14)
        lbl4.frame = CGRect(x:10, y:HEIGHT_SCREEN - 94, width:w2, height:20)
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
